title: How to check if SQLite database is locked
body: <p>I have an app that makes quite a few calls to a local SQLite3 database and sometimes these calls happen very close together (from different areas of the app).  How can I check, before a call to the database is made, if the database is currently locked?</p>
  
  <p>Ideally I would rewrite the app (which has grown far beyond its original scope) but won't have time in this iteration.</p>