issue/posting: Fix lastNumber if it is invalid.

This fixes PersistentException raises sometimes when post a new issue
or posting.