Is the ball considered to be in play or out of play when the goalkeeper has possession? What should be the restart if the goalkeeper commits a foul/misconduct when he has the ball in his hands?
The goalkeeper having the ball is just like any other player having it. The ball is in play.
The Laws clearly state when the ball is out of play:
The ball is out of play when:
it has wholly passed over the goal line or touchline on the ground or in the air
play has been stopped by the referee
it touches a match official, remains on the field of play and:
a team starts a promising attack or
the ball goes directly into the goal or
the team in possession of the ball changes
The ball is in play at all other times when it touches a match official and when it rebounds off a goalpost, crossbar or corner flagpost and remains on the field of play.
If the goalkeeper commits a foul while holding the ball it's treated like any other foul. Depending on the offence it would likely result in a penalty or indirect freekick.