Fix a crash when using sqliteCreateFunction

Summary: The segfault is reproduced by the test.
Without this fix, drupal 7 when configured to use sqlite is unusable.
The crash occurs for instance when clearing the cache.
Closes https://github.com/facebook/hhvm/pull/3512

Reviewed By: @ptarjan

Differential Revision: D1503431
check EAGAIN & EINTR in read

Summary: Closes https://github.com/facebook/hhvm/pull/3509

Reviewed By: @ptarjan

Differential Revision: D1503423
Don't apc_inc/dec on non-numerics

Summary: Closes https://github.com/facebook/hhvm/pull/3419

Reviewed By: @ptarjan

Differential Revision: D1488804