Fixed null pointer exception on adding new pointer to static thread
queue. Now, if the priority of a thread is checked before it is assigned
a state, a default state is initialized and assigned to it. Still need
to add functionality to specify thread priority explicitly when
necessary.