An internal expectation guides Drosophila egg-laying decisions