Fix none getattempt lambda

fix-none-getattempt-lambda is a cherry pick from #716, that fixes:
- a bug from #838 (see https://github.com/fail2ban/fail2ban/issues/838#issuecomment-60904420)
- a fix for disturbing "bug" within servertestcase - preventing to write into stderr (see https://github.com/fail2ban/fail2ban/pull/716#discussion-diff-14126349)
 - Could you expand on your first point? I don't quite understand.
 - Good point, but ideally the situation of `None` should be impossible, and any other errors would raise an exception anyway.
 - Not sure this is applicable in this branch though? (also the database was actually originally asynchronous, but came across a number of issues with this, so locking was implemented.)