Close session early for API GET requests.
API requests often have have long running database queries which causes session locking. Since such requests don't do any writes/deletes to the session calling session_write_close() should be safe and avoid blocking any concurrent requests for the same user.