(SERVER-39) Addressed PR feedback

This commit addresses initial feedback in the PR, including:

  * Use `with_open` to ensure `StringReader` for decoded cert is closed
    when finished

  * Added missing value to comparison in bad request test