You need an agreement which will cover the different scenarios you are worried about and lead to the outcome(s) you want. For example: say that you are worried about creative differences. You could decide that if one of you wants out of the project, he or she would have to sell his or her rights to any work and intellectual property done to date  to the other one for some predetermined price (e.g. $10k). Basically, either with or without an attorney's help--I'd recommend an attorney, but you could do this yourself--think about each situation that you're worried about. Consider what could happen, and then how you'd want it to be resolved. Then write up an agreement incorporating that. The best way to do this is to think things through in advance, then go to an attorney to both double check that you're covering what's important and make sure the agreement is drafted in an enforceable way.