run usercode before ending the request

Summary: Currently, the following happens at the end of a request:
onSendEnd -> run postsend functions -> hphp_context_exit

However, hphp_context_exit can call destructors for objects that are
alive at the end of request. This usercode should be allowed to send
output. This causes a circular reference issue because postsend
functions might need to access those objects.

When we don't have a postsend function, preserve Zend compatibility by
delaying the execution of onSendEnd.

Closes https://github.com/facebook/hhvm/pull/3279

Reviewed By: @markw65

Differential Revision: D1465876

Pulled By: svcscm