Close prepared statement before sync