Better handle trailing backslashes in ATX-style headers

Previously something like '# `\' would hang the parser while it
waited for an extra character that wasn't there.