Ensure that sqlite prepared statements are finalised even if an exception was thrown