Fix check to see if supplied selector worked.
Fix check to see if supplied selector worked.

You can't test a jQuery object for truthiness, because an empty object
will still evaluate to true. The only proper way is to test the length.

This was being done in two places, so I centralised it.

codebakery-ch/bootstrap-tabcollapse,flatlogic/bootstrap-tabcollapse,mesujan28/bootstrap-tabcollapse,Branodolny/bootstrap-tabcollapse,mattez/bootstrap-tabcollapse